package com.pengliu.service;

import java.io.File;
import java.io.IOException;
import java.util.Map;
import org.jsoup.Connection.Method;

/**
 * Http请求服务类,提供简单的基本请求信息封装
 */
public interface HttpService{
	
	String requestGet(String url) throws Exception;
	
	public String requestGet(String url,Map<String,String> data) throws Exception;
	
	public String requestGet(String url,Map<String,String> data,Map<String,String> heads) throws Exception;
	
	public String requestGet(String url,SetConnection setConnection) throws Exception;
	
	public String requestPost(String url,Map<String,String> data) throws Exception;
	
	public String requestPost(String url,Map<String,String> data,Map<String,String> heads) throws Exception;
	
	public String requestPost(String url,Map<String,String> data,Map<String,String> heads,String body) throws Exception;
	
	public String requestPost(String url,Map<String,String> data,SetConnection setConnection) throws Exception;
	
	public String requestHttp(String url,Method method,Map<String,String> data,SetConnection setConnection) throws Exception;
	
	public String doRequestHttp(String url,Method method,Map<String,String> data,SetConnection setConnection) throws Exception;
	
	public byte[] downloadFile(String url) throws Exception;
	
	public byte[] downloadFile(String url,Map<String,String> data,SetConnection setConnection) throws Exception;
	
	public byte[] doDownloadFile(String url,Map<String,String> data,SetConnection setConnection) throws IOException;
	
	public String uploadFile(String url,Map<String,String> data,File file,String fileRequestParam) throws Exception;

	public Map<String, String> getCookies();

	public void setCookies(Map<String, String> cookies);
	
	public void setShowLog(boolean isShowLog);
}
